package cn.xie.blog.serviceuserclient;

import cn.xie.blog.commonutil.response.Response;
import cn.xie.blog.model.common.param.login.LoginParam;
import cn.xie.blog.model.common.param.registered.RegisteredParam;
import feign.codec.ErrorDecoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: xiaoxie
 * create: 2025-04-26 11:38
 * @BelongsProject: blog-parent
 * @BelongsPackage: cn.xie.blog.serviceuserclient
 * description:
 */
@FeignClient(value = "service-user")
public interface UserClient {

    @PostMapping("/user/login")
    Response<String> userLogin(@RequestBody LoginParam loginParam);

    @PostMapping("/user/registered")
    Response<Boolean> registered(@RequestBody RegisteredParam registeredParam);

    @GetMapping("/user/code/{mail}")
    Response<Boolean> getCode(@PathVariable("mail") String mail);

    @GetMapping("/user/logout")
    Response<Boolean> logout();
}
